#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/11/18 19:34
# @Author  : FuKai ZHANG
# @File    : models.py
# @Description :这里使用pydantic库更规范的定义和使用数据接口

"""这里使用pydantic库更规范的定义和使用数据接口"""
from pydantic import BaseModel
from typing import Text, Union
from dataclasses import dataclass


class Email(BaseModel):
    """邮件通知"""
    send_user: Union[Text, None]
    email_host: Union[Text, None]
    stamp_key: Union[Text, None]
    # 收件人
    send_list: Union[Text, None]


class Config(BaseModel):
    """配置文件"""
    project_name: Text
    project_version: Text
    project_url: Text
    tester_name: Text
    email: "Email"
    mirror_source: Text


@dataclass
class TestMetrics:
    """ 用例执行状态 """
    passed: int
    failed: int
    broken: int
    skipped: int
    total: int
    pass_rate: float
    time: Text